/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.JSONArray;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * ClassName: MaterialCategory <br/>
 * Function: 物品类别 <br/>
 * date: 2018-11-07 11:40:01 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="material_categorys")
public class MaterialCategory extends MerchantGroupBaseTreeEntity<MaterialCategory> {

	private static final long serialVersionUID = 1L;

	// 编号 
    @Column(name="no", length = 300)
	private String no = null;

    //父级名称
    @Transient
	private String parentName = "";

	//创建的时候生成 编辑的时候不变
	@Column(name="uuid", length = 300)
	private String uuid = "";

	//更新的时间戳 long
	@Column(name="update_timestamp")
	private Long updateTimestamp = null;


	// 菜品库
	@Column(name="store_id")
	private Long storeId = null;

	// 商品类别id 不为空 不能删除不能编辑 不能选择
	@Column(name="dishes_category_id")
	private Long dishesCategoryId = null;

	@Transient
	private JSONArray materials;

    @Tolerate
	public MaterialCategory() {
		
	}
    @Tolerate
	public MaterialCategory(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取编号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置编号
     */
	public MaterialCategory setNo(String no) {
		this.no = no;
		return this;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public Long getUpdateTimestamp() {
		return updateTimestamp;
	}

	public void setUpdateTimestamp(Long updateTimestamp) {
		this.updateTimestamp = updateTimestamp;
	}

	public Long getStoreId() {
		return storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	public JSONArray getMaterials() {
		return materials;
	}

	public void setMaterials(JSONArray materials) {
		this.materials = materials;
	}

	public Long getDishesCategoryId() {
		return dishesCategoryId;
	}

	public void setDishesCategoryId(Long dishesCategoryId) {
		this.dishesCategoryId = dishesCategoryId;
	}
}
